<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>定时任务列表</title>
    <link href="../../css/bootstrap.min.css" rel="stylesheet">
    <link href="../../font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="../../css/animate.css" rel="stylesheet">
    <link href="../../css/plugins/jQueryUI/jquery-ui-1.10.4.custom.min.css" rel="stylesheet">
    <link href="../../css/style.css" rel="stylesheet">
	<link href="../../css/bootstrap-table.css" rel="stylesheet">
    <style type="text/css">
        [v-clock] {
            display: none !important;
        }
    </style>
</head>

<body style="background-color: #f3f3f4;overflow: hidden;" >
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-lg-10">
            <h2>角色管理</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="index.html">首页</a>
                </li>
                <li>
                    <span>基础设置</span>
                </li>
                <li class="active">
                    <span>任务管理</span>
                </li>
            </ol>
        </div>
    </div>
    <div id="ycapp" v-cloak>

        <!-- 内容 -->
        <div class="gray-bg">

            <div class="wrapper wrapper-content animated fadeInRight">
                <div id="toolbar" class="btn-group">
                    <button id="btn_add" type="button" @click="add" class="btn btn-default">
                        <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增
                    </button>
                    <button id="btn_edit" type="button" class="btn btn-default">
                        <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改
                    </button>
                    <button id="btn_delete" type="button" class="btn btn-default">
                        <span class="glyphicon glyphicon-remove" aria-hidden="true"></span>删除
                    </button>
                </div>
                <div class="row">
                    <div class="col-lg-12">
                        <div class="ibox ">
                            <div class="ibox-content">
                                <div class="jqGrid_wrapper">
                                    <table id="table_list"></table>
                                    <div id="pager_list"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="../../js/jquery-2.1.1.js"></script>
    <script src="../../js/plugins/layer/layer.js"></script>

    <!-- jqGrid -->
    <script src="../../js/bootstrap.min.js"></script>
    <script src="../../js/bootstrap-table.js"></script>
    <script src="../../js/bootstrap-table-zh-CN.js"></script>

    <script src="../../js/vue.min.js"></script>
    <script src="../../js/common.js"></script>

    <script>
        $(function(){
            var $table = $('#table');
            $table.bootstrapTable({
                striped:true,
                url:baseURL + "timerJob/page",
                method:"get",
                toolbar:"#toolbar",
                sidePagination:"server",
                strictSearch: true,
                smartDisplay:true,
                sortable:false,
                showRefresh:true,
                pagination:true,
                queryParams:queryParams,
                onLoadSuccess:function (data) {
                    if (data.total==0){
                        //layer.msg('未查询到数据', {icon: 6,time: 3*1000});
                        $table.bootstrapTable("removeAll");
                    }
                }, //参数
                queryParamsType: "limit", //参数格式,发送标准的RESTFul类型的参数请求
                columns: [{
                    checkbox:true
                }, {
                    field: 'jobName',
                    title: '任务名',
                    align: 'center'
                }, {
                    field: 'cronExpression',
                    title: '时间表达式',
                    align: 'center'
                } , {
                    field: 'className',
                    title: '类目',
                    align: 'center'
                } ,{
                    field: 'jobStatus',
                    title: '状态',
                    align: 'center',
                    formatter: function (value, row, index) {
                        if(value=="1"){
                            return "暂停";
                        }else{
                            return "启用";
                        }
                    }
                }]
            });
            /*封装查询参数*/
            function queryParams(params) {
                var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    size: params.limit,   //页面大小
                    current: (params.offset/params.limit)+1  //页码
                };
                return temp;
            }
        });
    </script>
</body>
</html>
